var messageController;
$(function () {
    messageController = new Vue({
        el:'#messageController',
        data:{
            nav:_mineNav,
            list:[],
            page:1,
            limit:10,
            busy:false,
            hasMore:true,
            messageType:{
                0:'错误',
                1:'系统通知',
                2:'拍卖消息',
                3:'订单消息',
                4:'系统送积分'
            }
        },
        methods:{
            getFirst:function (type) {
                var str = this.messageType[type];
                return str.substring(0,1);
            },
            jump:function (item) {
              return;
            },
            loadData:function () {
                var that = this;
                if (!that.hasMore){
                    return;
                }
                that.busy = true;
                sy.post('/web/home/myMessages',{
                    page:that.page,
                    limit:that.limit
                },function (data) {
                    data = data.data;
                    $.each(data,function(i,o){
                        that.list.push(o);
                    });
                    if(data.length < that.limit){
                        that.hasMore = false;
                    }else{
                        that.busy = false;
                        that.page ++;
                    }
                })
            }
        },
        created:function () {
            
        }
    });
})